<?php


namespace app\store\controller;


use app\common\bean\ConfigBean;
use app\common\bean\GlobalBean;
use app\common\bean\ListMap;
use app\common\bean\StoreBean;
use app\common\controller\StoreController;
use app\common\manage\ConfigManage;
use app\common\manage\StoreManage;
use app\common\utils\ExitJsonUtil;

class Store extends StoreController
{
    /** 商家配置
     * @return mixed
     * @throws \Exception
     */
    public function editConfig(){
        if(request()->isPost()){
            $listMap = new ListMap();
            $listMap->setData($this->postParams);
            $result = ConfigManage::getInstance()->editConfig($listMap,session(GlobalBean::$storeId));
            ExitJsonUtil::getInstance()->exitData($result);
        }
        $configList = ConfigManage::getInstance()->getConfig([ConfigBean::$storeId => session(GlobalBean::$storeId)]);
        $this->assign('configList',$configList);
        return $this->fetch();
    }
}